<template>
    <div class="container_step_page">
        <el-steps align-center :active="activeStep">
            <el-step v-for="(item, index) in stepList" :key="item.key">
                <template #icon>
                    <div class="step_num done" v-if="index < activeStep">
                        <div class="img">
                            <img src="@/assets/imgs/sys/check_orange.png" />
                        </div>
                        <div class="title">
                            {{ item.name }}
                        </div>
                    </div>
                    <div class="step_num current" v-else-if="index == activeStep">
                        <div class="icon">
                            {{ index + 1 }}
                        </div>
                        <div class="title">
                            {{ item.name }}
                        </div>
                    </div>
                    <div class="step_num wait" v-else-if="index > activeStep">
                        <div class="icon">
                            {{ index + 1 }}
                        </div>
                        <div class="title">
                            {{ item.name }}
                        </div>
                    </div>
                </template>
            </el-step>
        </el-steps>
    </div>
</template>
<script setup>
const props = defineProps({
    stepList: { type: Array, default: () => [{ name: '填写开户资料' }, { name: '绑卡' }, { name: '开通成功' }] },
    activeStep: { type: [Number, String], default: 0 }
});
</script>
<style lang="scss" scoped>
.container_step_page {
    :deep(.el-step__icon.is-icon) {
        width: auto;
        padding: 0 16px;
    }
    :deep(.is-finish .el-step__line) {
        background: #ff6b00;
        height: 1px;
    }
    :deep(.is-wait .el-step__line) {
        height: 1px;
        background: #eaeaea;
    }
    :deep(.is-process .el-step__line) {
        height: 1px;
        background: #eaeaea;
    }
    :deep(.el-step__line-inner) {
        display: none;
    }

    .step_num {
        font-size: 16px;
        line-height: 30px;
        display: flex;
        .title {
            margin-left: 8px;
        }
        .icon {
            width: 32px;
            height: 32px;
            text-align: center;
            border-radius: 50%;
            font-family: HelveticaNeue;
            box-sizing: border-box;
        }
        &.wait {
            .icon {
                color: #969696;
                border: 1px solid rgba(0, 0, 0, 0.15);
            }
            .title {
                font-family: PingFangSC-Regular, PingFang SC;
                font-weight: 400;
                color: #999999;
            }
        }
        &.current {
            .icon {
                border: 1px solid #ff6b00;
                background: #ff6b00;
                color: #ffffff;
            }
            .title {
                font-family: PingFangSC-Medium, PingFang SC;
                font-weight: 550;
                color: #585858;
            }
        }
        &.done {
            .img {
                color: #ff6b00;
                width: 32px;
                height: 32px;
                img {
                    width: 100%;
                    height: 100%;
                }
            }
            .title {
                font-weight: 400;
                color: #585858;
            }
        }
    }
}
</style>
